﻿<div class="carouselContainer">
    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
        <!-- Indicators -->
        <ol class="carousel-indicators">
            <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
            <li data-target="#carousel-example-generic" data-slide-to="1"></li>
            <li data-target="#carousel-example-generic" data-slide-to="2"></li>
        </ol>

        <!-- Wrapper for slides -->
        <div class="carousel-inner">
            <?php foreach ($carouselElements as $key => $element): ?>
                <div class="item <?php echo($key == 0 ? "active" : ""); ?>">
                    <img src="/uploads/images/<?php echo($element->getImage()) ?>" alt="...">
                    <div class="carousel-caption" style="color: <?php echo $element->getTextColor(); ?>">
                        <h3><a target="_blank" href="http://<?php echo $element->getUrl(); ?>"><?php echo($element->getTitle()); ?></a></h3>
                    </div>
                </div>                
            <?php endforeach; ?> 
        </div>

        <!-- Controls -->
        <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left"></span>
        </a>
        <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right"></span>
        </a>
    </div> <!-- Carousel -->

</div>
<div class="mainPageBoxContainer">
    <?php if ($news): ?>
        <a href="<?php echo url_for('@news?id=' . $news->getId()); ?>">
            <div class="mainPageBox">
                <div class="mainPageBoxTitle">
                    <?php echo($news->getTitle()); ?>
                </div>
                <img class="imgHD" src="<?php echo('/uploads/images/' . $news->getImage()); ?>">
            </div>
        </a>
    <?php else: ?>
        <div class="mainPageBox">
            <div class="mainPageBoxTitle">
                Message not found
            </div>
            <center>No message to display.</center>
        </div>
    <?php endif; ?>
    <div class="mainPageBox">
        <div class="mainPageBoxTitle">
            Old messages
        </div>
        <?php if($newses->count() > 0): ?>
        <?php foreach ($newses as $key => $loopNews): ?>
            <div class="oldNews <?php echo(($key % 2 == 0) ? "strippedNews" : ""); ?>">
                <a href="<?php echo url_for('@news?id=' . $loopNews->getId()); ?>" class="tableUrl">
                    <?php
                    echo $loopNews->getTitle();
                    ?>
                </a>
            </div>
        <?php endforeach; ?>
        <?php else: ?>
            <div class="oldNews">
                <center>No messages to display.</center>
            </div> 
        <?php endif?>

    </div>
    <div class="mainPageBox noMargin">
        <div class="mainPageBoxTitle">
            Tytuł 3
        </div>
        <img class="imgHD" src="../img/okno1.jpg">
    </div>
</div>